package com.carlos.company.exc;//package com.knox.aurora.common.exception;

import cn.hutool.jwt.JWTException;
import com.carlos.company.vo.ResultVO;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author 李健成
 */

@ControllerAdvice
public class GlobalExceptionHandler {

    /**
     * 捕获 JWT 异常
     */
    @ResponseBody
    @ExceptionHandler(value = JWTException.class)
    public ResultVO<Void> handle(JWTException e) {
        return new ResultVO<Void>().fail(e.getMessage());
    }

}
